package com.doyens.gmall.cart.client;


import com.doyens.gmall.cart.client.fallback.CartDegradeFeignClient;
import com.doyens.gmall.common.result.Result;
import com.doyens.gmall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@FeignClient(value = "service-cart",fallback = CartDegradeFeignClient.class)
public interface CartFeignClient {
    @PostMapping("api/cart/addToCart/{skuId}/{skuNum}")
    Result addToCart(@PathVariable("skuId") Long skuId, @PathVariable("skuNum") Integer skuNum);
    @GetMapping("api/cart/cartList")
    Result cartList();

    @GetMapping("api/cart/getCartCheckedList/{userId}")
    List<CartInfo> getCartCheckedList(@PathVariable("userId") String userId);

    @GetMapping("api/cart/loadCartCache/{userId}")
    Result loadCartCache(@PathVariable("userId")String userId);
}
